package net.yzwlab.daap.util;

public class Log {

	public static void d(String tag, String message) {
		if (tag == null || message == null) {
			throw new IllegalArgumentException();
		}
		System.err.println("[DEBUG] " + tag + ": " + message);
	}

	public static void d(String tag, String message, Throwable th) {
		if (tag == null || message == null || th == null) {
			throw new IllegalArgumentException();
		}
		System.err.println("[DEBUG] " + tag + ": " + message);
		th.printStackTrace();
	}

	public static void w(String tag, String message) {
		if (tag == null || message == null) {
			throw new IllegalArgumentException();
		}
		System.err.println("[WARN] " + tag + ": " + message);
	}

	public static void w(String tag, Throwable e) {
		if (tag == null || e == null) {
			throw new IllegalArgumentException();
		}
		System.err.println("[WARN] " + tag + ": " + e.getMessage());
		e.printStackTrace();
	}

	public static void i(String tag, String message) {
		if (tag == null || message == null) {
			throw new IllegalArgumentException();
		}
		System.err.println("[INFO] " + tag + ": " + message);
	}

	public static void e(String tag, String message) {
		if (tag == null || message == null) {
			throw new IllegalArgumentException();
		}
		System.err.println("[ERROR] " + tag + ": " + message);
	}

	public static void e(String tag, String message, Throwable th) {
		if (tag == null || message == null || th == null) {
			throw new IllegalArgumentException();
		}
		System.err.println("[ERROR] " + tag + ": " + message);
		th.printStackTrace();
	}

	public static void e(String tag, Throwable e) {
		if (tag == null || e == null) {
			throw new IllegalArgumentException();
		}
		System.err.println("[ERROR] " + tag + ": " + e.getMessage());
		e.printStackTrace();
	}

}
